package exercise3;

/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214st2215
 * @Package: exercise3
 * @File: Step.java
 * @Time: 2023/2/28 15:39
 * @Author: abcque
 * @Description: 计算 n 的阶乘
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class Step {
    public static void main(String[] args) {
        int s = step(3);
        System.out.println("s = " + s);
    }

    public static int step(int n){
        if (n == 1){
            return 1;
        }
        else {
            return n * step(n - 1);
        }
    }
}
